{% extends 'base_login.html' %}
{% load i18n %}

{% block title %}
	<h2>{% trans "Blog and Pages" %}</h2>
{% endblock %}

{% block main %}
	<h3>{% trans "Pages" %}</h3>
	
	<div class="grid_10 margin_v padding_v">
		<div class="grid_5 alpha omega"><span>{% trans "Title" %}</span></div>
		<div class="grid_3 alpha omega"><span>{% trans "Last Updated" %}</span></div>
		<div class="grid_2 alpha omega"><span>&nbsp;</span></div>
	</div>
	<div class="clear"></div>

	<div class="grid_10 padding_v detail1 %}">
		<div class="grid_5 alpha omega"><a href="{% url page_edit_home %}">{% trans "Home" %}</a></div>
		<div class="grid_3 alpha omega"><span>{{ home.last_updated|date:"d F Y H:i" }}</span></div>
		<div class="grid_2 alpha omega"><span>&nbsp;</span></div>
	</div>
	<div class="clear"></div>

	<div class="grid_10 padding_v detail2 %}">
		<div class="grid_5 alpha omega"><a href="{% url page_edit_about %}">{% trans "About Us" %}</a></div>
		<div class="grid_3 alpha omega"><span>{{ about.last_updated|date:"d F Y H:i" }}</span></div>
		<div class="grid_2 alpha omega"><span>&nbsp;</span></div>
	</div>
	<div class="clear"></div>
	
	{% for page in pages %}
		<div class="grid_10 padding_v {% cycle 'detail1' 'detail2' %}">
			<div class="grid_5 alpha omega"><a href="{% url page_edit page.id %}">{{ page.name }}</a></div>
			<div class="grid_4 alpha omega"><span>{{ page.last_updated|date:"d F Y H:i" }}</span></div>
			<div class="grid_1 alpha omega"><a href="javascript:delete_object('{% url page_delete page.id %}', 'page')"><img src="{{ MEDIA_URL }}img/remove.png"></a></div>
		</div>
		<div class="clear"></div>
	{% endfor %}
	
	<br/>
	
	<a href="{% url page_create %}">{% trans "Create a new page" %}</a>
	

	<h3>{% trans "Blog" %}</h3>
	
	<div class="grid_15 margin_v padding_v">
		<div class="grid_4 alpha omega"><span>{% trans "Title" %}</span></div>
		<div class="grid_3 alpha omega"><span>{% trans "Time" %}</span></div>
		<div class="grid_7 alpha omega"><span>{% trans "Post" %}</span></div>
		<div class="grid_1 alpha omega"></div>
	</div>
	<div class="clear"></div>
	
	{% for post in posts %}
		<div class="grid_15 padding_v {% cycle 'detail1' 'detail2' %}">
			<div class="grid_4 alpha omega"><a href="{% url post_edit post.id %}">{{ post.title }}</a></div>
			<div class="grid_3 alpha omega"><span>{{ post.date_time|date:"d F Y H:i" }}</span></div>
			<div class="grid_7 alpha omega"><span>{{ post.body|slice:":60" }}...</span></div>
			<div class="grid_1 alpha omega"><a href="javascript:delete_object('{% url post_delete post.id %}', 'post')"><img src="{{ MEDIA_URL }}img/remove.png"></a></div>
		</div>
		<div class="clear"></div>
	{% endfor %}
	
	<p><a href="{% url post_add %}">{% trans "New Post" %}</a></p>
	
	
{% endblock %}

{% block menu %}
	{% include 'blog_pages/blog_menu.html' %}
{% endblock %}